<link rel="stylesheet" href="/assets/assets(home)/css/comment_list.css">

<title>评论列表</title>

<!-- <header class="mui-bar mui-bar-nav mui-bar-nav-bg">
    <a id="icon-menu" class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
    <h1 class="mui-title">评论列表</h1>
</header> -->

<!-- 评论内容 -->
{if isset($list)}
<ul class="mui-table-view list">
    {foreach $list as $item}
    <li class="mui-table-view-cell mui-media">
        <img class="mui-media-object mui-pull-left userimg" src="{$item.business.avatar_text}">
        <div class="mui-media-body">
            <div class="header">
                <span class="nickname">{$item.business.nickname}</span>
                对
                <a class="course"
                    href="{:url('home/search/details')}?subid={$item.subject.id}">{$item.subject.title}</a>
                评论：
            </div>
            <p>{$item.content}</p>
            <div class="rate">
                {for start="1" end="6"}
                {if $i elt $item.rate}
                <span>
                    <img src="/assets/assets(home)/images/rate_active.png" alt="">
                </span>
                {else /}
                <span>
                    <img src="/assets/assets(home)/images/rate.png" alt="">
                </span>
                {/if}
                {/for}
            </div>
        </div>
    </li>
    {/foreach}
</ul>
{/if}

<script>
    //修改浏览器自带的后退按钮
    window.history.pushState(null, null, ``);

    window.addEventListener('popstate', function (e) {
        e.preventDefault()
        location.href = `{:url('/home/index/index')}`
    }, false)
</script>